# from app.order.check.model import CheckOrder as CheckOrderTable
# from app.order.check.model import CheckOrderSku as CheckOrderSkuTable
# from app.order.purchase.abs_model import PurchaseOrder
# from common.constant import OrderType
#
# from app.storage.abs_model import Warehouse, WarehouseRecord
#
#
# class CheckOrder(PurchaseOrder):
#     OrderTableClass = CheckOrderTable
#     OrderSkuTableClass = CheckOrderSkuTable
#     order_sn_prefix = 'PD'
#     order_type = OrderType.CHECK
#
#     def _update_warehouse_record_by_submit(self, order_sku_table):
#         """盘点 直接修改数量，不修改成本单价"""
#         warehouse_record = WarehouseRecord(order_sku_table.sku_id, self.order_table.warehouse_id)
#         # 并将当前库存保存在order_sku_table中
#         order_sku_table.before_num = warehouse_record.warehouse_record_table.num
#
#         warehouse_record.update_num(num=order_sku_table.num)
#
#     def _update_warehouse_record_by_revoke(self, order_sku_table):
#         """盘点撤销 增加数量, 不修改成本单价"""
#         warehouse_record = WarehouseRecord(order_sku_table.sku_id, self.order_table.warehouse_id)
#         warehouse_record.update_num(num=order_sku_table.before_num)
#
#     def _create_warehouse_flow(self, order_sku_table):
#         """盘点 改变数量"""
#         warehouse = Warehouse(self.order_table.warehouse_id, self.user_id)
#         warehouse.create_flow(self.user_id, self.order_type, self.id,
#                               order_sku_table.sku_id, order_sku_table.num - order_sku_table.before_num)
#
#     def _create_account_flow(self):
#         """盘点 无"""
#         pass
#         # raise Exception("check order can not create account flow")
